package com.peam;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 启动程序
 * 
 * @author peam
 */
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class,
    //    SecurityAutoConfiguration.class,
       // org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
      //  org.activiti.spring.boot.SecurityAutoConfiguration.class
      // SecurityAutoConfiguration.class
       org.activiti.spring.boot.SecurityAutoConfiguration.class,
})

public class PeamApplication
{
    public static void main(String[] args) throws UnknownHostException {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication app = new SpringApplication(PeamApplication.class);

        ConfigurableApplicationContext context = app.run(args);
        System.out.println("(♥◠‿◠)ﾉﾞ  新疆指挥中心启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");

        String port = context.getEnvironment().getProperty("server.port");
        String protocol = "http";
        String host = InetAddress.getLocalHost().getHostAddress();
        System.out.println("\n----------------------------------------------------------\n\t" +
                "Application '" + context.getEnvironment().getProperty("spring.application.name") + "' is running! Access URLs:\n\t" +
                "Local: \t\t" + protocol + "://localhost:" + port + "/swagger-ui/index.html\n\t" +
                "External: \t" + protocol + "://" + host + ":" + port + "/swagger-ui/index.html\n----------------------------------------------------------");



    }
}
